package com.itheima.day16.work;

import java.lang.reflect.Field;

public class ReflectDemo2 {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchFieldException {
        Class<?> aClass = Class.forName("com.itheima.day16.work.Student");
        Field name = aClass.getDeclaredField("name");
        name.setAccessible(true);
        Object o = aClass.newInstance();
        name.set(o,"qw");
        System.out.println(name.get(o));
    }
}
